﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestPlatform.Core;
using Raven.Client;
using TestPlatform.Performer.RavenDB.Entities;

namespace TestPlatform.Performer.RavenDB
{
    public class RavenDBGetByIdPerformer : BaseGetByIdPerformer
    {
        public override string UnderlyinEngine { get { return "RavenDB"; } }

        public RavenDBGetByIdPerformer()
            : base(new RavenDBHelper())
        {

        }

        protected override void EntityGetById(Guid id)
        {
            using (IDocumentSession s = RavenDBHelper.Store.OpenSession())
            {
                User user = s.Load<User>(id);
                Defer(user.Id, user.Login, user.Name);
            }
        }
    }
}
